drm/etnaviv: trick drm_mm into giving out a low IOVA
authorLucas Stach <l.stach@pengutronix.de>
Mon, 12 Dec 2016 15:15:17 +0000 (16:15 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:05:39 +0000 (03:05 +0000)
commit4bc82eab52980c93fb9758c3d823cf6a248bcb53
tree56f8126ca769ee69a1c6ac6ab6c81f299a80d1ec
parent92ec5c93627eac0bbe3dfd7352b76733513d2afd
drm/etnaviv: trick drm_mm into giving out a low IOVA

[ Upstream commit 3546fb0cdac25a79c89d87020566fab52b92867d ]

After rollover of the IOVA space, we want to get a low IOVA address,
otherwise the the games we play by remembering the last IOVA are
pointless. When we search for a free hole with DRM_MM_SEARCH_DEFAULT,
drm_mm will pop the next entry from the free holes stack, which will
likely be a high IOVA. By using DRM_MM_SEARCH_BELOW we can trick
drm_mm into reversing the search and provide us with a low IOVA.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir van der Laan <laanwj@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/etnaviv/etnaviv_mmu.c